<include file="./Application/Home/View/Public/header.html" />
                <!-- Main content -->
                <section class="content">
                    <div class="row">
                        <div class="col-xs-12">
                            <div class="box box-primary">
                                <div class="box-header">
                                <i class="glyphicon glyphicon-host"></i>
                                    <h3 class="box-title"> 用户列表</h3>
                                </div><!-- /.box-header -->
                                <div class="box-body table-responsive">
                                    <table id="hostlist" class="table table-bordered table-hover">
                                        <thead>
                                            <tr>
                                                <th>ID</th>
                                                <th>FTP-ID</th>
                                                <th>MYSQL-ID</th>
                                                <th>绑定域名</th>
                                                <th>网站路径</th>
                                                <th>是否启用</th>
                                                <th>创建时间</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        <volist name="hostlist" id="host">
                                            <tr class="class{$host.id}">
                                                <td>{$host.id}</td>
                                                <td>{$host.ftpid}</td>
                                                <td>{$host.mysqlid}</td>
                                                <td>{$host.domain}</td>
                                                <td>{$host.route}</td>
                                                <td><if condition="$host.isenable eq 1"><span class="label label-success">启用</span><elseif condition="$host.isenable eq 2"/><span class="label label-danger">停止</span></if></td>
                                                <td>{$host.created_time|date="Y-m-d H:i:s",###}</td>
                                                <td><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="设置">
                                                        <span class="fa fa-gear"></span>
                                                    </button>
                                                    <button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="停止">
                                                      <span class="fa fa-stop"></span>
                                                    </button>
                                                    <button id="delete{$host.id}" onclick="deleteid('{$host.id}');" type="button" class="btn btn-danger" data-toggle="tooltip" data-placement="top" title="删除">
                                                      <span class="glyphicon glyphicon-remove"></span>
                                                    </button>
                                                </td>
                                            </tr>
                                            </volist>
                                        </tbody>
                                    </table>
                                </div><!-- /.box-body -->
                            </div><!-- /.box -->
                        </div>
                    </div>

                </section><!-- /.content -->
            </aside><!-- /.right-side -->
        </div><!-- ./wrapper -->
        <!-- page script -->
        <!-- DATA TABES SCRIPT -->
        <script src="__PUBLIC__/style/js/plugins/datatables/jquery.dataTables.js" type="text/javascript"></script>
        <script src="__PUBLIC__/style/js/plugins/datatables/dataTables.bootstrap.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(function() {
                $('#hostlist').dataTable({
                    "bPaginate": true,  /*是否显示分页*/
                    "bLengthChange": true,  /*每页显示记录数*/
                    "bFilter": true, /*搜索栏*/
                    "bSort": false, /*是否支持排序功能*/
                    "bInfo": true, /*显示表格信息*/
                    "bAutoWidth": true, /*自适应宽度*/

                    "bStateSave": true, //保存状态到cookie *************** 很重要 ， 当搜索的时候页面一刷新会导致搜索的消失。使用这个属性就可避免了、
                    "oLanguage": {
                        "sLengthMenu": "每页显示 _MENU_ 条记录",
                        "sZeroRecords": "对不起，查询不到任何相关数据",
                        "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录",
                        "sInfoEmtpy": "找不到相关数据",
                        "sInfoFiltered": "数据表中共为 _MAX_ 条记录)",
                        "sProcessing": "正在加载中...",
                        "sSearch": "搜索",
                        "oPaginate": {
                        "sFirst":    "第一页",
                        "sPrevious": " 上一页 ",
                        "sNext":     " 下一页 ",
                        "sLast":     " 最后一页 "
                    }
                },
                });
            });
            function deleteid(id) {
                if(confirm("是否确认删除")){
                  $('#delete'+id).attr('disabled','disabled');
                  $.ajax({
                    type: "POST",
                    url: "deleteHost",
                    data: {"hostingid":id},
                    success: function(msg){
                      if(msg == "0" || msg == 0){
                        ZENG.msgbox.show("删除失败！", 5, 3000);
                    }else if(msg == "1" || msg == 1){
                         location.href = "hostinglist";
                         $('#delete'+id).removeAttr("disabled");
                    }
                }
            });
              }else{
                    return false;
                }
            }
        </script>
<include file="./Application/Home/View/Public/footer.html" />